home *** CD-ROM | disk | FTP | other *** search
/ Sound Fx / Sound Fx.iso / Software / UNZIPED / MPW181-5 / _SETUP.1 / args.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-04-19  |  2.8 KB  |  153 lines

  1. /* args.h
  2.  
  3.     An abstract class to pass values to maplay and other worker
  4.    threads.
  5.  
  6.     From the Win32 API, we can only pass one 32-bit value to a thread. This will
  7.    be a pointer to a object of this class. The Args class contains the seeking
  8.    control variables needed for both MPEG and MCI files.
  9.  
  10.    Added stop and done variables and functions for terminating the
  11.    threads from outside.
  12.  
  13.    This class should be used to pass arguments to maplay(),
  14.    and to initialize the Obuffer's. */
  15.  
  16. #ifndef ARGS_H
  17. #define ARGS_H
  18.  
  19. #ifdef __WIN32__
  20. #define STRICT
  21. #include <wtypes.h>
  22. #include <windows.h>
  23. #endif // __WIN32__
  24.  
  25. #include "all.h"
  26. #include "ibitstr.h"
  27. #include "header.h"
  28.  
  29. #ifdef SEEK_STOP
  30. #include "mutx_imp.h"
  31. #endif
  32.  
  33. class Args
  34. {
  35.     public:
  36.  
  37.     Args()
  38.    {
  39.  
  40. #ifdef SEEK_STOP
  41.         mutex               = NULL;
  42.        stop             = FALSE;
  43.       done             = FALSE;
  44.       desired_position = 0;
  45.       position_change  = FALSE;
  46. #endif // SEEK_STOP
  47.  
  48. #ifdef __WIN32__
  49.        hWnd             = NULL;
  50. #endif // __WIN32__
  51.    }
  52.  
  53.     virtual ~Args() {}
  54.  
  55. #ifdef SEEK_STOP
  56.     _Mutex mutex;
  57.    volatile BOOL  stop;
  58.    volatile BOOL  done;
  59.       volatile int32 desired_position;
  60.     volatile BOOL  position_change;
  61. #endif // SEEK_STOP
  62.  
  63. #ifdef __WIN32__
  64.     HWND hWnd;
  65. #endif // __WIN32__
  66.  
  67. };
  68.  
  69. // A class to contain arguments for maplay.
  70. class MPEG_Args : public Args
  71. {
  72. public:
  73.  
  74.     MPEG_Args()
  75.     {
  76.         stream = NULL;
  77.         MPEGheader = NULL;
  78.         which_c = both;
  79.        use_own_scalefactor = FALSE;
  80.        scalefactor = 32768.0;
  81.  
  82. #ifdef __WIN32__
  83.           phwo = NULL;
  84. #endif // __WIN32__
  85.  
  86. #ifdef COMMAND_LINE
  87.       stdout_mode = FALSE;
  88. #endif
  89.  
  90. #if defined(SPARC) || defined(HPUX)
  91.        use_speaker   = FALSE;
  92.       use_headphone = FALSE;
  93.       use_line_out  = FALSE;
  94. #endif // SPARC || HPUX
  95.  
  96. #if defined(SPARC) && defined(ULAW)
  97.         force_amd     = FALSE;
  98. #endif // SPARC && ULAW
  99.  
  100. #if defined(SPARC) || defined(HPUX) || defined(AIX)
  101.       volume = -1.0f;
  102. #endif // SPARC || HPUX || AIX
  103.  
  104.       }
  105.  
  106.     Ibitstream *stream;
  107.     Header *MPEGheader;
  108.     enum e_channels which_c;
  109.  
  110.    BOOL use_own_scalefactor;
  111.    real scalefactor;
  112.  
  113. #ifdef __WIN32__
  114.     HWAVEOUT *phwo;
  115. #endif // __WIN32__
  116.  
  117.    BOOL stdout_mode;
  118.  
  119. #if defined(SPARC) || defined(HPUX)
  120.    BOOL use_speaker;
  121.    BOOL use_headphone;
  122.    BOOL use_line_out;
  123. #endif // SPARC || HPUX
  124.  
  125. #if defined(SPARC) && defined(ULAW)
  126.     BOOL force_amd;
  127. #endif // SPARC && ULAW
  128.  
  129. #if defined(SPARC) || defined(HPUX) || defined(AIX)
  130.    float volume;
  131. #endif // SPARC || HPUX || AIX
  132.  
  133.     ~MPEG_Args() { }
  134. };
  135.  
  136. #ifdef __WIN32__
  137. // A class to hold the arguments for MCI playing.
  138. class MCI_Args : public Args {
  139.  
  140. public:
  141.     MCI_Args()
  142.     {
  143.         playing = FALSE;
  144.     }
  145.  
  146.    ~MCI_Args() { }
  147.  
  148.     volatile BOOL playing;
  149. };
  150. #endif // __WIN32__
  151.  
  152. #endif // ARGS_H
  153.